package com.irdstudio.efp.esb.service.mock.ms;

import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.stereotype.Service;

import com.irdstudio.efp.esb.common.constant.MsLoanConstant;
import com.irdstudio.efp.esb.service.bo.req.MsLoanReq;
import com.irdstudio.efp.esb.service.bo.resp.MsLoanResp;
import com.irdstudio.efp.esb.service.facade.MsLoanService;
import com.irdstudio.basic.framework.core.base.FrameworkService;

/**
 * 马上贷款审核通知接口（广州银行->马上）
 * 
 * @author heyingfeng
 * @since 2018年12月18日 下午4:33:36
 * @version 1.0
 */
@Service("msLoanService")
public class MsLoanServiceImpl implements MsLoanService, FrameworkService {

	private static Logger log = LoggerFactory.getLogger(MsLoanServiceImpl.class);

	// 发送请求
	@Override
	public MsLoanResp msLoan(MsLoanReq msLoanReq) {
		try {
			// MsLoanResp msLoanResp =
			// ESBClientFactory.buildClient().withBody(msLoanReq).withTradeNo(MsLoanConstant.TRADE_NO_30220006)
			// .withScene(MsLoanConstant.SCENE_01).create().sendAndReceive().getBody(MsLoanResp.class);
			MsLoanResp msLoanResp = new MsLoanResp();
			msLoanResp.setRetStCd(MsLoanConstant.RetCodeEnum.SUCCESS.VALUE);
			msLoanResp.setRtnMsg("交易成功！");
			return msLoanResp;
		} catch (Exception e) {
			log.error("马上审批结果消费接口调用失败！");
			e.printStackTrace();
		}
		return null;
	}

}
